package de.fhaugsburg.games.boardgames.tests;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import de.fhaugsburg.games.boardgames.CircularList;
import de.fhaugsburg.games.boardgames.Player;

public class CircularListTest {
	
	private CircularList<Player> cl;
	private Player chris;
	private Player hans;
	private Player fritz;

	@Before
	public void setUp() throws Exception {
		cl = new CircularList<Player>();
		chris = new Player("chris");
		fritz = new Player("fritz");
		hans = new Player("hans");
		
		cl.add(chris);
		cl.add(fritz);
		cl.add(hans);
	}

	@Test
	public void testAdd() {
		
		System.out.println(cl.getAll().toString());
	}

	@Test
	public void testNext() {
	
		assertEquals(fritz, cl.next());
	}

	@Test
	public void testReset() {
		cl.reset();
		assertTrue(cl.getAll().isEmpty());
	}

	@Test
	public void testPrev() {
		assertEquals(hans, cl.prev());
	}

	

}
